package com.eightbears.beboy.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eightbears.beboy.R;
import com.eightbears.beboy.base.util.CommonUtils;
import com.eightbears.beboy.entity.SystemMessageEntity;

/**
 *
 * Created by Bao on 2016/12/7.
 */

public class SystemMessageAdapter extends BaseQuickAdapter<SystemMessageEntity.SystemMessage, BaseViewHolder> {

    public SystemMessageAdapter() {
        super(R.layout.item_system_message, null);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, SystemMessageEntity.SystemMessage systemMessageEntity) {

        baseViewHolder.setText(R.id.tv_message, systemMessageEntity.getMessage())
                .setText(R.id.tv_publish_date, CommonUtils.TimeStamp2Date(systemMessageEntity.getCreated_at(), "yyyy-MM-dd HH:mm"))
                .addOnClickListener(R.id.ll_item);

    }
}
